#!/bin/sh

# SPDX-FileCopyrightText: © 2018-2022 Peter Lemenkov
#
# SPDX-License-Identifier: CC0-1.0

. "`dirname "$0"`/../functions"

DIR=$1

autotrace -report-progress -filter-iterations 0 -error-threshold 1 -centerline $DIR/testrect.pbm -output-format svg -output-file $DIR/testrect.svg
diff -q -w --strip-trailing-cr $DIR/testrect.output.svg $DIR/testrect.svg
RESULT=$?

if [ $RESULT -eq 0 ] && [ -s $DIR/testrect.svg ] ; then
    rm -f $DIR/testrect.svg
    ok
else
    fail "$DIR/testrect.output.svg not equal to $DIR/testrect.svg"
fi
